Skip to content

fix: point the README demo GIF at a fresh URL - #131

Closed
Uking-xxx wants to merge 1 commit into
mainfrom
fix/readme-demo-gif-url
Closed

Uking-xxx wants to merge 1 commit into
mainfrom
fix/readme-demo-gif-url

Conversation

@Uking-xxx

Copy link
Copy Markdown
Collaborator

背景

README 里的 StepPage 演示 GIF 在 GitHub 上只播一半就断了。逐层排查后定位到 GitHub 的图片代理 Camo:

源站 Camo 返回
字节 4149835 1801375(43%)
分辨率 800x450 900x506(旧版本)
帧数 133 66
完整性 正常 LZW decode failed

Camo 在 CDN 刷新过程中抓取,拿到一个传输中断的残缺文件并缓存了下来(x-cache: HIT, max-age=31536000)。它的缓存键是源地址的 HMAC,所以原地覆盖同名文件永远无法让它回源 —— 这也是先前多次刷新 CDN 都无效的原因。

首次上传的 7.5 MB 文件还另外触发了一个问题:超过 Camo 的 5 MiB 代理上限,直接返回 404。

修复

两个 README 的图片地址改为 demo1-v2.gif,给 Camo 一个全新的 URL 去抓取。新文件同时重新编码为 900x506 / 8fps,在保证终端文字可读的前提下留出充足的体积余量。

验证

改 README 之前先确认源站返回完整文件,避免 Camo 再缓存一个坏副本:

  • content-length 4352323,且无 age 头(回源新鲜响应)
  • 完整下载后 MD5 c7db1a9b0e415ccf6e0795de4798abc7 与本地文件逐字节一致
  • ffprobe 读出 900x506 / 133 帧,无解码报错
  • 4352323 字节 = Camo 5 MiB 上限的 83%

npm run check 通过。

边界

本次只改图片地址,不动文案与其他内容。旧的 demo1-small.gif 仍留在 CDN 上,其对应的 Camo 缓存要到一年后才过期,不再被引用。

GitHub proxies external images through Camo, which fetched the demo GIF
while the CDN was mid-refresh and cached the truncated result: 1801375
of 4149835 bytes, 66 of 133 frames, and a broken LZW stream, so the
animation stopped partway through. Camo keys its cache on an HMAC of the
source URL and holds it for a year, so replacing the file in place could
never dislodge it.

Point both READMEs at demo1-v2.gif, which gives Camo a new URL to fetch.
The file is also re-encoded at 900x506 and 8fps to keep terminal text
legible while staying well under Camo's 5 MiB proxy limit, which the
original 7.5 MB upload had exceeded.
@Uking-xxx
Uking-xxx marked this pull request as draft September 22, 2026 11:11
@Uking-xxx Uking-xxx closed this Sep 22, 2026
@Uking-xxx
Uking-xxx deleted the fix/readme-demo-gif-url branch September 22, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant